// 二级路由
// 实现路由懒加载
import { lazy, Suspense } from 'react'
// 引入防抖函数
import { AuthComponent } from '../../components/suspense/index'
// 引入二级路由组件
var Supplier = lazy(() => import('./Purchasemanage/Supplier'))
var Shopping = lazy(() => import('./Purchasemanage/Shopping'))
var Shoppingedit = lazy(() => import('./Purchasemanage/Shoppingedit'))
var Credit = lazy(()=>import('./Purchasemanage/Credit'))
var Requirent = lazy(() => import('./Purchasemanage/Requirent'))
var Requirentedit = lazy(() => import('./Purchasemanage/Requirentedit'))
var NotFound = lazy(() => import('../../components/Notfound'))
var Supplieredit = lazy(() => import('./Purchasemanage/Supplieredit'))

export default [ //Goods模块的二级路由
    {
        path:'/index/supplier',
        element: <AuthComponent permission={4}><Supplier /></AuthComponent>,
    },
    {
        path: '/index/shopping',
        element: <AuthComponent permission={4}><Shopping /></AuthComponent>
    },
    {
        path: '/index/credit',
        element: <AuthComponent permission={4}><Credit /></AuthComponent>
    },
    {
        path: '/index/requirent',
        element: <AuthComponent permission={4}><Requirent /></AuthComponent>
    },
    {
        path: '/index/supplieredit',
        element: <AuthComponent permission={4}>< Supplieredit /></AuthComponent>
    },
    {
        path: '/index/requirentedit',
        element: <AuthComponent permission={4}>< Requirentedit /></AuthComponent>
    },
    {
        path: '/index/Shoppingedit',
        element: <AuthComponent permission={4}>< Shoppingedit /></AuthComponent>
    },
    // 404
    {
        path: '*',
        element: <NotFound />
    },
]